/**
 * Created by IntelliJ IDEA.
 * User: Liu Yuhong
 * Date: 12-10-25
 * Time: 下午5:05
 * Subpage tender page functions.
 */

$(function() {
    var menuGroups = [
        {
            'menuId': "tenderMenu",
            'menuTitle':getLanMsg("0ec22400-000064"),
            'iconImg': null,
            'needShow': bModuleEBPOrSCM_CT,
            'items': [               
                {
                    'itemId': "tenderMenuItem0",                  
                    "itemUrl": ".",
                    'itemName': getLanMsg("0ec22400-000065"),
                    'needShow': bModuleEBPOrSCM_CT && bStdVersion,
                    'callback': function() {window.location = ebvp_context + "/contract/contractconfirm?menuid=38";  return false; }
                },
                {
                    'itemId': "tenderMenuItem1",                  
                    "itemUrl": ".",
                    'itemName': getLanMsg("0ec22400-000066"),
                    'needShow': bModuleEBPOrSCM_CT,
                    'callback': function() {window.location = ebvp_context + "/contract/contractlist?menuid=34";  return false;} 
                },
                {
                    'itemId': "tenderMenuItem2",                   
                    "itemUrl": ".",
                    'itemName': getLanMsg("0ec22400-000067"),
                    'needShow': bModuleEBP && bStdVersion,        
                    'callback': function() {window.location = ebvp_context + "/contractprice/ctreptlist?menuid=35";  return false;}  
                },
                {
                    'itemId': "tenderMenuItem3",
                    "itemUrl": ".",
                    'itemName': getLanMsg("0ec22400-000188"),
                    'needShow': bModuleEBPOrSCM_CT,
                    'callback': function() {window.location = ebvp_context + "/contract/initCtPriceAd";  return false;}         
                },
                {
                    'itemId': "tenderMenuItem4",
                    "itemUrl": ".",
                    'itemName': getLanMsg("0ec22400-000189"),
                    'needShow': bModuleEBPOrSCM_CT,
                    'callback': function() {window.location = ebvp_context + "/contract/initCtPrice";  return false;}                  
                }              
            ]
        }
    ];

    /* 左侧菜单栏 */
    $( "#columnLeft" ).UIColumnMenu({
        'menuGroups': menuGroups,
        'menuHeight': heigth,
        'singleGroup': true
    });
    
    $(function() {	
    	if(t==1){
			$( "#tenderMenuItem0" ).parents("ul").find(".current").removeClass("current");
			$( "#tenderMenuItem0" ).addClass("current");
    	}
    	if(t==2){
    		$( "#tenderMenuItem1" ).parents("ul").find(".current").removeClass("current");
    		$( "#tenderMenuItem1" ).addClass("current");
    	}
    	if(t==3){
    		$( "#tenderMenuItem2" ).parents("ul").find(".current").removeClass("current");
    		$( "#tenderMenuItem2" ).addClass("current");
    	}
    	if(t==4){
    		$( "#tenderMenuItem3" ).parents("ul").find(".current").removeClass("current");
    		$( "#tenderMenuItem3" ).addClass("current");
    	}
    	if(t==5){
    		$( "#tenderMenuItem4" ).parents("ul").find(".current").removeClass("current");
    		$( "#tenderMenuItem4" ).addClass("current");
    	}
	 });

});
